#ifndef IMAGELOADER_H
#define IMAGELOADER_H

#include <tchar.h>	 // Include UNICODE support

#include <d2d1.h> // Include the Direct2D API.
#pragma comment(lib, "d2d1.lib") // Connect to the Direct2D Import Library.

#include <wincodec.h>
#pragma comment(lib, "windowscodecs.lib")

#include <dwrite.h> // Include the DirectWrite API.
#pragma comment(lib, "dwrite.lib") // Connect to the DirectWrite Import Library.

class ImageLoader
{
public:
	ImageLoader(){};
	HRESULT startUp();
	ID2D1Bitmap* loadImage(ID2D1RenderTarget *pRenderTarget, IWICImagingFactory *pIWICFactory, PCWSTR fileName, BOOL mirrored);
	HRESULT LoadBitmapFromFile(
        ID2D1RenderTarget *pRenderTarget,
        IWICImagingFactory *pIWICFactory,
        PCWSTR uri,
        UINT destinationWidth,
        UINT destinationHeight,
        ID2D1Bitmap **ppBitmap
        );
    HRESULT LoadBitmapFromFile(
        ID2D1RenderTarget *pRenderTarget,
        IWICImagingFactory *pIWICFactory,
        PCWSTR uri,
        BOOL bMirrored,
        ID2D1Bitmap **ppBitmap
        );
	HRESULT LoadBitmapFromResources(
		ID2D1RenderTarget *pRenderTarget,
		IWICImagingFactory *pIWICFactory,
		PCWSTR resourceName,
		PCWSTR resourceType,
		UINT destinationWidth,
		UINT destinationHeight,
		ID2D1Bitmap **ppBitmap
		);
private:
	IDWriteFactory* pDWFactory;
	IDWriteTextFormat* pTF;

	// WIC Interfaces:
	IWICImagingFactory *pWICFactory;
};

#endif